<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue中的mvvm模型</title>
  <!-- 引入vue -->
  <script src="../js/vue.js"></script>
</head>

<!-- 
 -->

<body>
  <div id="root">
    <button v-on:click="btn1">按钮1</button>
    <button @click="btn2(12,$event)">按钮1</button>
  </div>

  <script type="text/javascript">
    // 阻止vue启动的时候产生生产提示
    Vue.config.productionTip = false;

     // 创建Vue实例
     const vm = new Vue({
      el: '#root',
      methods: {
        btn1() {
          console.log('执行了btn1函数');
        },
        btn2(num, event) {
          console.log('执行了btn2函数', num, event);
        }
      }
    })
       
    // 挂载容器
    vm.$mount('#root')
  </script>
</body>

</html>